-
Notifications
You must be signed in to change notification settings - Fork 50
Allow for model excluded fields in MPDataDoc construction #989
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Think I may have gotten the
should correctly return pydantic documents now The alternate solution would be ensuring emmet has no forward references, but that will require a redeploy |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @esoteric-ephemera! As this does not seem to break backward-compatibility, I'm ok with merging and releasing a new version to take care of the phonon issue. Unfortunately, the test for PhononRester
still fails - same on my local machine. I ran the tests against the adkaplan-tls
branch in this repo since secrets (in this case API keys) are not forwarded to forks.
Thanks @tschaume, the issue was not importing external Also there's an undocumented pydantic kwarg that makes it cleaner to include external locals in a model. Making use of that now |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tests look good. Gtg!
Depends on emmet-core #1253, which adds a top-level structure field to
PropertyDoc
On
model_dump
, thestructure
field should be excluded, and should not appear in the JSON schema. This adds parsing of the exclude attr of a model field inapi_sanitize